package com.xca.znb.model.impl;

import android.content.Context;

import com.xca.znb.database.UserDAO;
import com.xca.znb.entity.Goods;
import com.xca.znb.entity.NewsLetter;
import com.xca.znb.entity.User;
import com.xca.znb.model.imodel.IGoodsDetail;

public class GoodsDetailImpl implements IGoodsDetail {
    private UserDAO userDAO ;
    public GoodsDetailImpl(Context context){userDAO = new UserDAO(context) ;}
    @Override
    public Goods getGoodsById(int id) {
        return userDAO.getGoodsById(id);
    }

    @Override
    public User getUserByPhone(String phone) {
        return userDAO.getUser(phone);
    }

    @Override
    public void addNewsletter(String phone1, String phone2, String time) {
        userDAO.addNewsletter(phone1, phone2, time);
    }

    @Override
    public NewsLetter getNewsLetterByPhone(String phone1, String phone2) {
        return userDAO.getNewsletterByPhone(phone1, phone2);
    }

    @Override
    public int getLocalDefaultId(String phone) {
        return userDAO.getLocalDefaultId(phone);
    }
}
